<!--
 * @Author: 轻语
 * @Date: 2021-12-29 17:28:36
 * @LastEditors: 轻语
 * @LastEditTime: 2021-12-30 18:14:56
 * @Description: 
-->
<template>
  <button @click="getList">列表get请求</button>
  <button @click="getDetail">详情post请求</button>
  <button @click="getDetail">表单post请求</button>
  <button @click="getDetail">文件post请求</button>
</template>

<script lang='ts'>
import {defineComponent} from 'vue'
import api from '@/api'
const { goods: goodsApi } = api

export default defineComponent({
  setup() { 
    function getList() {
      console.log(this.$http)
      this.$http.get('goods/list', {params: {a:1}, contentType: 'aaa'})
    }
    function getDetail() {
      goodsApi.detail({ a:1 }).then(res => {
        console.log(res)
      })
    }
    return {
      getDetail,
      getList
    }
  }
})
</script>
